package com.tengju.data.domain.model.clickhouse;

import com.tengju.data.domain.model.clickhouse.dashboard.MonthQuarterEnum;
import com.tengju.data.domain.model.user.StarLevelEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.List;

/**
 * 人群视角
 */
@Getter
@AllArgsConstructor
public enum CrmRankCrowdPerspective {

    KA(1,List.of(StarLevelEnum.SEC,StarLevelEnum.EEC)),

    EC(2,List.of(StarLevelEnum.EC)),

    CITY_STAR(3,List.of(StarLevelEnum.CITY_STAR_ONE,
            StarLevelEnum.CITY_STAR_TWO,StarLevelEnum.CITY_STAR_THREE,
            StarLevelEnum.CITY_STAR_FOUR)),

    DEALER(4,List.of(StarLevelEnum.NONE,StarLevelEnum.CITY_STAR_ONE,
            StarLevelEnum.CITY_STAR_TWO,StarLevelEnum.CITY_STAR_THREE,
            StarLevelEnum.CITY_STAR_FOUR,StarLevelEnum.EC,
            StarLevelEnum.SEC,StarLevelEnum.EEC));

    private Integer val;
    private List<StarLevelEnum> starLevels;


    public static CrmRankCrowdPerspective parseByVal(Integer val) {
        
        for (CrmRankCrowdPerspective crmRankCrowdPerspective : CrmRankCrowdPerspective.values()) {
            if (crmRankCrowdPerspective.getVal().equals(val)) {
                return crmRankCrowdPerspective;
            }
        }
        return null;
    }

    public String getShowLabel() {
        switch (val) {
            case 1:
                return "SEC(ID)";
            case 2:
                return "EC(ID)";
            case 3:
                return "城市服务商(ID)";
            case 4:
                return "社群(ID)";
            default:
                return "";

        }
    }

}
